using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
    [Table("bgm_request_pass"), DataContract]
    public class RequestPass
    {

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "BgmReqPassId", ResourceType = typeof(Resources.RequestPassResource))]
        [Column("bgm_req_pass_seq", TypeName="int")]
        public int BgmReqPassId { get; set; }

        [ForeignKey("BgmReq")]
        [DataMember, Display(Name = "BgmReqId", ResourceType = typeof(Resources.RequestPassResource))]
        [Column("bgm_req_seq", TypeName="int")]
        public Nullable<int> BgmReqId { get; set; }

        [ForeignKey("JobSite")]
        [DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.RequestPassResource))]
        [Column("job_site_seq", TypeName="int")]
        public Nullable<int> JobSiteId { get; set; }

        [DataMember]
        public virtual Request BgmReq { get; set; }

        [DataMember]
        public virtual HRM.JobSite JobSite { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}